<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    
</body>
<script>
    //条件判断
    let xhs = 5,xg = 1;
    if (xg>0){
        xhs = 1;
    }
    console.log(xhs);
    /*
    if (条件表达式){
        条件为真
    }else{
        条件不为真
    }
    */
   //取两个值中的最大值
   let pto = 4,pg = 2, max;
   if(pto>pg){
        max = pto;
   }else{
        max = pg;
   }
   console.log('最大值是：'+max)
   console.log('--------------------');

   let num1 = 234,num2 = 342, zuidazhi;
   if(num1>num2){
            zuidazhi= num1;
   }else if(num1<num2){
            zuidazhi = num2;
   }else{
           console.log('num1和num2相等');ss
   }
   console.log('最大值是：'+zuidazhi);
</script>
</html>